package com.aspose.cells;

final class ziy {
   public static void a(zn var0, ziw var1) throws Exception {
      if (!var1.D()) {
         com.aspose.cells.b.a.b.zc var2 = zax.a(var1.d(), com.aspose.cells.a.c.zn.a(var1.a));

         try {
            var0.a(var2, var1.a);
         } finally {
            if (var2 != null) {
               var2.f();
            }

         }

         if (var1.f().f()) {
            zama.a(var0, var1.a, var1.f());
         }

      }
   }

   public static void a(zn var0, zif var1) throws Exception {
      zalv var2 = var1.i().f();
      float var3 = (float)var2.b().a();
      com.aspose.cells.b.a.b.zs var4 = var1.T();
      com.aspose.cells.b.a.b.zp var5 = new com.aspose.cells.b.a.b.zp(0, 0, var4.b(), var4.c());
      float var6;
      float var7;
      com.aspose.cells.b.a.b.zq var8;
      if (var3 <= 1.0F) {
         var6 = (float)(var1.a() - 1);
         var7 = (float)(var1.b() - 1);
         var8 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var6, var7);
      } else {
         var6 = (float)var1.a();
         var7 = (float)var1.b();
         var8 = new com.aspose.cells.b.a.b.zq(var3 / 2.0F, var3 / 2.0F, var6, var7);
      }

      if (var1.w()) {
         zax.a(var0, com.aspose.cells.a.c.zn.a(var5), var1.i().d());
         zama.b(var0, var8.f(), var8.g(), var8.h(), var8.i(), var1.i().f());
      } else {
         com.aspose.cells.b.a.b.zc var9 = zax.a(var1.i().d(), com.aspose.cells.a.c.zn.a(var5));

         try {
            a(var0, var9, (float)var5.c(), (float)var5.d(), (float)var5.e(), (float)var5.f(), 13.0F);
         } finally {
            if (var9 != null) {
               var9.f();
            }

         }

         com.aspose.cells.b.a.b.zm var10 = zama.a(var1.i().f());

         try {
            a(var0, var10, var8.f(), var8.g(), var8.h(), var8.i(), 13.0F);
         } finally {
            if (var10 != null) {
               var10.r();
            }

         }
      }

   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zm var1, float var2, float var3, float var4, float var5, float var6) {
      com.aspose.cells.b.a.b.a.ze var7 = new com.aspose.cells.b.a.b.a.ze();
      var7.b(var2 + var6, var3, var2 + var4 - var6 * 2.0F, var3);
      var7.a(var2 + var4 - var6 * 2.0F, var3, var6 * 2.0F, var6 * 2.0F, 270.0F, 90.0F);
      var7.b(var2 + var4, var3 + var6, var2 + var4, var3 + var5 - var6 * 2.0F);
      var7.a(var2 + var4 - var6 * 2.0F, var3 + var5 - var6 * 2.0F, var6 * 2.0F, var6 * 2.0F, 0.0F, 90.0F);
      var7.b(var2 + var4 - var6 * 2.0F, var3 + var5, var2 + var6, var3 + var5);
      var7.a(var2, var3 + var5 - var6 * 2.0F, var6 * 2.0F, var6 * 2.0F, 90.0F, 90.0F);
      var7.b(var2, var3 + var5 - var6 * 2.0F, var2, var3 + var6);
      var7.a(var2, var3, var6 * 2.0F, var6 * 2.0F, 180.0F, 90.0F);
      var7.i();
      var0.a(var1, var7);
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zc var1, float var2, float var3, float var4, float var5, float var6) {
      com.aspose.cells.b.a.b.a.ze var7 = new com.aspose.cells.b.a.b.a.ze();
      var7.b(var2 + var6, var3, var2 + var4 - var6 * 2.0F, var3);
      var7.a(var2 + var4 - var6 * 2.0F, var3, var6 * 2.0F, var6 * 2.0F, 270.0F, 90.0F);
      var7.b(var2 + var4, var3 + var6, var2 + var4, var3 + var5 - var6 * 2.0F);
      var7.a(var2 + var4 - var6 * 2.0F, var3 + var5 - var6 * 2.0F, var6 * 2.0F, var6 * 2.0F, 0.0F, 90.0F);
      var7.b(var2 + var4 - var6 * 2.0F, var3 + var5, var2 + var6, var3 + var5);
      var7.a(var2, var3 + var5 - var6 * 2.0F, var6 * 2.0F, var6 * 2.0F, 90.0F, 90.0F);
      var7.b(var2, var3 + var5 - var6 * 2.0F, var2, var3 + var6);
      var7.a(var2, var3, var6 * 2.0F, var6 * 2.0F, 180.0F, 90.0F);
      var7.i();
      var0.a(var1, var7);
   }
}
